/**
 * Copyright 2010-2025 The mTASK Project Authors. All Rights Reserved.
 * Licensed under the MIT License (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.gitee.com/lort/mTask/LICENSE.md
 * Author: luyunyi @luyunyi2019@outlook.com
 */

#ifndef __MTASKDBG_H__
#define __MTASKDBG_H__

#include <mTaskType.h>

#ifdef __cplusplus
extern "C"
{
#endif

#define DBG_VERBOSE			1
#define DBG_DEBUG			2
#define DBG_ERROR			4


#define mTaskPrintf		printf



void   mTaskPrintByts(char* s, uint8_t* pdata, int len);


#define mTaskPrint(fmt,...)\
		do{ \
			if(fmt)\
				{mTaskPrintf("%s,%s,%d:",(char*)(strrchr(__FILE__,'/')+1) ,(char*)__FUNCTION__ ,__LINE__ );}\
			if(fmt)\
				{mTaskPrintf(__VA_ARGS__);}\
		}while(0)

#define mTaskPrintB(fmt,...)\
		do{ \
			if(fmt)		\
				{mTaskPrintf("%s,%s,%d:",(char*)(strrchr(__FILE__,'/')+1) ,(char*)__FUNCTION__ ,__LINE__ );}\
			if(fmt)		\
				{mTaskPrintByts(__VA_ARGS__);}\
		}while(0)



#ifdef __cplusplus
}
#endif


#endif /* MAIN_ELOOP_ELOOP_LOG_H_ */
